//
//  PZRMusicTableViewCell.m
//  Moment
//
//  Created by pang on 15/12/30.
//  Copyright © 2015年 片刻. All rights reserved.
//

#import "PZRMusicTableViewCell.h"

@implementation PZRMusicTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}
-(void)create
{
    self.titleLabel = [[UILabel alloc]init];
    //self.titleLabel.backgroundColor = [UIColor yellowColor];
    //self.titleLabel.frame = CGRectMake(0, 0, 20, 20);
    [self.contentView addSubview:_titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake([UIScreen mainScreen].bounds.size.width , 40));
        make.left.and.top.mas_equalTo(10);
        make.right.mas_equalTo(-10);
    }];
    
    self.detailLabel = [[UILabel alloc]init];
    //self.detailLabel.backgroundColor = [UIColor redColor];
    self.detailLabel.numberOfLines = 0;
    [self.contentView addSubview:_detailLabel];
    [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        //make.height.mas_equalTo(self.contentView.size.height);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(10);
        make.left.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.bottom.mas_equalTo(-10);
    }];
    
        
    self.timeLabel = [[UILabel alloc]init];
    //self.timeLabel.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:_timeLabel];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(80, 20));
        make.top.equalTo(self.detailLabel.mas_bottom).offset(10);
        make.left.mas_equalTo(10);
        
    }];
    
    
    

    
    
}
-(void)setASociety:(Society *)aSociety
{
    if (_aSociety != aSociety) {
        _aSociety = aSociety;
    }
    self.titleLabel.text = aSociety.title;
    self.timeLabel.text = aSociety.addtime_f;
    //NSLog(@"%@!!!",self.timeLabel.text);
    self.detailLabel.text = aSociety.content;
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
